package com.rd.student.ruanjian.class1.duhang.New00;

import java.util.ArrayList;
import java.util.Scanner;

public class TestAnimal {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        ArrayList<Animal> list = new ArrayList<>();
        System.out.println("选择迎接哪位客人：1.张女士 2.王女士");
        switch (scanner.nextInt()) {
            case 1:
                System.out.println(" 给你的宠物取个名字 ");
                String nameanimal = scanner.next();
                System.out.println(" 输入你想要选择的宠物：1.小猫 2.小狗 3.小猪");
                switch (scanner.nextInt()) {
                    case 1:
                        Cat cat = new Cat(nameanimal, "蓝色眼睛");
                        list.add(cat);
                    case 2:
                        Dog dog = new Dog(nameanimal, "黄色皮毛");
                        list.add(dog);
                    case 3:
                        Pig pig = new Pig(nameanimal);
                        list.add(pig);
                }
                Lady lady = new Lady("张女士", list.get(0));
                System.out.println(lady.getName() + "买了一只" + list.get(0));
                lady.myPetEnjoy();
                break;
            case 2:
                System.out.println(" 给你的宠物取个名字 ");
                String nameanimal1 = scanner.next();
                System.out.println(" 输入你想要选择的宠物：1.小猫 2.小狗 3.小猪");
                switch (scanner.nextInt()) {
                    case 1:
                        Cat cat = new Cat(nameanimal1, "蓝色眼睛");
                        list.add(cat);
                    case 2:
                        Dog dog = new Dog(nameanimal1, "黄色皮毛");
                        list.add(dog);
                    case 3:
                        Pig pig = new Pig(nameanimal1);
                        list.add(pig);
                }
                Lady lady1 = new Lady("王女士", list.get(0));
                System.out.println(lady1.getName() + "买了一只" + list.get(0));
                lady1.myPetEnjoy();
                break;
        }
    }
}
